package com.miaomiao.mapper.system;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.miaomiao.domain.system.Menu;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

public interface MenuMapper extends BaseMapper<Menu> {
    List<String> selectPermsByUserId(Long userid);

    List<Menu> selectMenuByUserId(Menu menu);
    List<Menu> selectMenuAll(Menu menu);


    @Insert("insert into sys_user_role values(#{userid},2)")
    Boolean addRole(Long userId);

    @Insert("insert into sys_role_menu values(#{roleId},#{menuId})")
    Boolean addRoleMenu(Long roleId,Long menuId);

    List<Menu> selectMenuTreeByUserId(Long userId);

    List<Menu> getRoleMenus(Long roleId);
}
